package org.demo.base.config;

public class Result {
	public final static int Success = 1;
	public final static int Failure = 2;
	public final static int Forbidden = 3;

	private int code;
	private Object data;
	private String message;

	public static Result Success(Object data) {
		Result res = new Result();
		res.code = Success;
		res.data = data;
		return res;
	}

	public static Result Failure(String message) {
		Result res = new Result();
		res.code = Failure;
		res.message = message;
		return res;
	}

	public static Result Forbidden(String message) {
		Result res = new Result();
		res.code = Forbidden;
		res.message = message;
		return res;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
